package cn.echogo.framework.http;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;

import cn.echogo.framework.http.imp.FormRequestEntity;
import cn.echogo.framework.http.imp.JsonResponseEntity;

public class HttpDataHelper {

	public static RequestEntity newFormRequestEntity() {
		return new FormRequestEntity();
	}

	public static RequestEntity newFormRequestEntity(String key, String value, String... moreKeyAndValue) {
		RequestEntity req = new FormRequestEntity();
		req.put(key, value);
		if (moreKeyAndValue != null && moreKeyAndValue.length > 0) {
			for (int i = 0; i < moreKeyAndValue.length; i += 2) {
				req.put(moreKeyAndValue[i], moreKeyAndValue[i + 1]);
			}
		}
		return req;
	}

	public static RequestEntity newJsonRequestEntity() {
		return null;
	}

	public static RequestEntity newXmlRequestEntity() {
		return null;
	}

	public static ResponseEntity newJsonResponseEntity(InputStream inputStream, String charset, int length) throws IOException {
		return new JsonResponseEntity(inputStream, charset, length);
	}

	public static ResponseEntity newXmlResponseEntity(InputStream inputStream) {
		return null;
	}

}
